/*!
\copyright  Copyright (c) 2024 Qualcomm Technologies International, Ltd.
            All Rights Reserved.
            Qualcomm Technologies International, Ltd. Confidential and Proprietary.
\file
\brief      Implementation of common LE Audio OTS specifc testing functions.
*/

#include "le_audio_ots_test.h"
#include <logging.h>

#ifdef INCLUDE_GATT_OTS_CLIENT_MODULE

UNITCODESECTION(KEEP)
static void  appTestMediaControlClient_ReadOts_cb(media_control_client_ots_callback_msg_t ots_callback_msg)
{
    /* LOG MCP ID */
    switch(ots_callback_msg.id)
    {
        case MCP_MEDIA_PLAYER_ICON_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID: MCP_MEDIA_PLAYER_ICON_OBJ_ID_CFM");
        break;

        case MCP_CURRENT_TRACK_SEGMENTS_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID: MCP_CURRENT_TRACK_SEGMENTS_OBJ_ID_CFM");
        break;

        case MCP_CURRENT_TRACK_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID: MCP_CURRENT_TRACK_OBJ_ID_CFM");
        break;

        case MCP_NEXT_TRACK_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID: MCP_NEXT_TRACK_OBJ_ID_CFM");
        break;

        case MCP_CURRENT_GROUP_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID: MCP_CURRENT_GROUP_OBJ_ID_CFM");
        break;

        case MCP_PARENT_GROUP_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_PARENT_GROUP_OBJ_ID_CFM");
        break;

        case MCP_SEARCH_RESULT_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_SEARCH_RESULT_OBJ_ID_CFM"); 
        break;

        case MCP_INIT_OPT_SERVICES_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_INIT_OPT_SERVICES_CFM");
        break;

        case MCP_OTS_IND_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_OTS_IND_CFM");
        break;

        case MCP_GET_OBJECT_CONTENTS_BY_OBJ_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_GET_OBJECT_CONTENTS_BY_OBJ_ID_CFM");
        break;

        case MCP_START_DISCOVER_OBJECT_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_START_DISCOVER_OBJECT_CFM");
        break;

        case MCP_STOP_DISCOVER_OBJECT_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_STOP_DISCOVER_OBJECT_CFM");
        break;

        case MCP_GET_CURRENT_MEDIA_OBJECT_TYPE_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_GET_CURRENT_MEDIA_OBJECT_TYPE_CFM");
        break;

        case MCP_GET_CURRENT_MEDIA_OBJECT_SIZE_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_GET_CURRENT_MEDIA_OBJECT_SIZE_CFM");
        break;

        case MCP_GET_CURRENT_MEDIA_OBJECT_ID_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_GET_CURRENT_MEDIA_OBJECT_ID_CFM");
        break;

        case MCP_GET_CURRENT_MEDIA_OBJECT_PROP_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_GET_CURRENT_MEDIA_OBJECT_PROP_CFM");
        break;

        case MCP_GET_CURRENT_MEDIA_OBJECT_NAME_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_GET_CURRENT_MEDIA_OBJECT_NAME_CFM");
        break;

        case MCP_ABORT_OTS_PROCEDURE_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_ABORT_OTS_PROCEDURE_CFM");
        break;

        case MCP_SET_MEDIA_OBJECT_CONTENT_CFM:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_SET_MEDIA_OBJECT_CONTENT_CFM");
        break;

        case MCP_DISCOVER_OBJECT_TYPE_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_DISCOVER_OBJECT_TYPE_IND");
        break;

        case MCP_DISCOVER_OBJECT_SIZE_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_DISCOVER_OBJECT_SIZE_IND");
        break;

        case MCP_DISCOVER_OBJECT_ID_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_DISCOVER_OBJECT_ID_IND");
        break;

        case MCP_DISCOVER_OBJECT_PROP_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_DISCOVER_OBJECT_PROP_IND");
        break;

        case MCP_DISCOVER_OBJECT_NAME_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_DISCOVER_OBJECT_NAME_IND");
        break;

        case MCP_OBJECT_CHANGED_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_OBJECT_CHANGED_IND");
        break;

        case MCP_CURRENT_TRACK_OBJ_ID_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_CURRENT_TRACK_OBJ_ID_IND");
        break;

        case MCP_NEXT_TRACK_OBJ_ID_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_NEXT_TRACK_OBJ_ID_IND");
        break;

        case MCP_CURRENT_GROUP_OBJ_ID_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_CURRENT_GROUP_OBJ_ID_IND");
        break;

        case MCP_PARENT_GROUP_OBJ_ID_IND:
        DEBUG_LOG("appTestMediaControlClient_ReadOts_cb MCP ID:MCP_PARENT_GROUP_OBJ_ID_IND");
        break;
    }

    DEBUG_LOG_INFO("appTestMediaControlClient_ReadOts_cb: Status: 0x%x, cid: 0x%x, enum:MCPMessageId: 0x%x, dataLen: %d, moreToCome: %d",
                    ots_callback_msg.status, ots_callback_msg.cid, ots_callback_msg.id, ots_callback_msg.data_length, ots_callback_msg.moreToCome);

    /* Log data if exist */
    if (ots_callback_msg.data_length)
    {
        DEBUG_LOG_DATA_ALWAYS(ots_callback_msg.data, ots_callback_msg.data_length);
    }
}

UNITCODESECTION(KEEP)
void appTestMediaControlClient_RegisterOtsCallback(void)
{
    MediaControlClient_RegisterOtsClientCallback(appTestMediaControlClient_ReadOts_cb);
}

#endif /*INCLUDE_GATT_OTS_CLIENT_MODULE*/
